package com.tenchael.iblog.commons;

import java.util.regex.Pattern;

/**
 * Created by tenchael on 26/12/2017.
 */
public interface Contants {

	class ErrorCode {
		public static final int SUCCESS_CODE = 0;
		public static final int PARAM_ERROR = 99;
		public static final int USER_NOT_EXIST = 100;
		public static final int WRONG_PASSWORD = 101;
		public static final int USER_ALREADY_EXIST = 102;
		public static final int USER_EMAIL_ALREADY_EXIST = 103;
		public static final int SYSTEM_ERROR = 800;
		public static final int UNKOWN_ERROR = 999;
	}

	class RegPattern {
		public static final Pattern USERNAME_PATTERN = Pattern.compile("^[A-Za-z0-9._-]{6,20}$");
		public static final Pattern PASSWORD_PATTERN = Pattern.compile("^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\\S+$).{8,}$");
		public static final Pattern EMAIL_PATTERN = Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$",
				Pattern.CASE_INSENSITIVE);
	}


}
